import request from './request';
export default {
  //常见问题相关
  faq: {
    getFaqList: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<FaqModel>>>> => request.doRequest('faq/getFaqList', 'GET', data, option),//获取常见问题列表
  },
  //购物车相关
  cart: {
    getCartContents: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<CartContentModel>>>> => request.doRequest('cart/getCartContents', 'GET', data, option),//获取购物车内容
    addToCart: (data?: CartAddToCartParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('cart/addToCart', 'POST', data, option, 'application/x-www-form-urlencoded'),//添加购物车
    modifyCount: (data?: CartModifyCountParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('cart/modifyCount', 'POST', data, option, 'application/x-www-form-urlencoded'),//修改购物车数量
    deleteCartContent: (data?: CartDeleteCartContentParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('cart/deleteCartContent', 'POST', data, option, 'application/x-www-form-urlencoded'),//修改购物车条目
    getCartContentCount: (data?: any, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('cart/getCartContentCount', 'GET', data, option),//获取购物车商品数量
  },
  //用户相关
  user: {
    getProfile: (data?: any, option?: any): Promise<ApiResponse<ResData<UserProfile>>> => request.doRequest('user/getProfile', 'GET', data, option),//获取用户信息
    getOrderCounts: (data?: any, option?: any): Promise<ApiResponse<ResData<OrderCounts>>> => request.doRequest('user/getOrderCounts', 'GET', data, option),//获取订单数量列表
    getCouponCounts: (data?: any, option?: any): Promise<ApiResponse<ResData<CouponCounts>>> => request.doRequest('user/getCouponCounts', 'GET', data, option),//获取优惠券数量列表
    getMessageCount: (data?: any, option?: any): Promise<ApiResponse<ResData<number>>> => request.doRequest('user/getMessageCount', 'GET', data, option),//获取消息数量
    editProfile: (data?: EditProfileParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('user/editProfile', 'POST', data, option, 'application/json'),//修改个人信息
  },
  //活动相关
  event: {
    getEvent: (data?: EventGetEventParam, option?: any): Promise<ApiResponse<ResData<EventModel>>> => request.doRequest('event/getEvent', 'GET', data, option),//获取活动
  },
  //首页相关
  index: {
    getBannerList: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<BannerModel>>>> => request.doRequest('index/getBannerList', 'GET', data, option),//获取Banner列表
    getCourseList: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<CourseModel>>>> => request.doRequest('index/getCourseList', 'GET', data, option),//获取课程视频列表
    getHotSearchList: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<string>>>> => request.doRequest('index/getHotSearchList', 'GET', data, option),//获取热搜列表
    reportExplainEnabled: (data?: any, option?: any): Promise<ApiResponse<ResData<boolean>>> => request.doRequest('index/reportExplainEnabled', 'GET', data, option),//报告解读功能是否开启

  },
  //登录相关
  login: {
    wxLogin: (data?: LoginWxLoginParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('login/wxLogin', 'POST', data, option, 'application/x-www-form-urlencoded'),//微信登录
    wxPhoneLogin: (data?: LoginWxPhoneLoginParam, option?: any): Promise<ApiResponse<ResData<boolean>>> => request.doRequest('login/wxPhoneLogin', 'POST', data, option, 'application/x-www-form-urlencoded'),//微信手机号登录
    checkLogin: (data?: any, option?: any): Promise<ApiResponse<ResData<boolean>>> => request.doRequest('login/checkLogin', 'POST', data, option, 'application/x-www-form-urlencoded'),//检查登录状态
    logout: (data?: any, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('login/logout', 'POST', data, option, 'application/x-www-form-urlencoded'),//退出登录
    getSmsLoginValidateImage: (data?: any, option?: any): Promise<any> => request.doRequest('login/getSmsLoginValidateImage', 'GET', data, option, "x-image-key", 'arraybuffer'),//获取图片验证码
    sendSmsCode: (data?: LoginSendSmsCodeParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('login/sendSmsCode', 'POST', data, option, 'application/x-www-form-urlencoded'),//发送短信验证码
    smsLogin: (data?: LoginSmsLoginParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('login/smsLogin', 'POST', data, option, 'application/x-www-form-urlencoded'),//短信验证码登录
  },
  //订单相关
  order: {
    previewOrder: (data?: PreviewOrderParam, option?: any): Promise<ApiResponse<ResData<PreviewOrderResult>>> => request.doRequest('order/previewOrder', 'POST', data, option, 'application/json'),//预览订单
    getUsableCouponList: (data?: GetUsableCouponListParam, option?: any): Promise<ApiResponse<ResData<Array<CouponModel>>>> => request.doRequest('order/getUsableCouponList', 'POST', data, option, 'application/json'),//获取优惠券列表
    createOrder: (data?: CreateOrderParam, option?: any): Promise<ApiResponse<ResData<CreateOrderResult>>> => request.doRequest('order/createOrder', 'POST', data, option, 'application/json'),//创建订单
    getOrderList: (data?: OrderGetOrderListParam, option?: any): Promise<ApiResponse<ResData<PageData<OrderModel>>>> => request.doRequest('order/getOrderList', 'GET', data, option),//获取订单列表
    getOrderDetail: (data?: OrderGetOrderDetailParam, option?: any): Promise<ApiResponse<ResData<OrderModel>>> => request.doRequest('order/getOrderDetail', 'GET', data, option),//获取订单详情
    getClientPayParam: (data?: OrderGetClientPayParamParam, option?: any): Promise<ApiResponse<ResData<string>>> => request.doRequest('order/getClientPayParam', 'POST', data, option, 'application/x-www-form-urlencoded'),//获取支付参数
    cancelOrder: (data?: OrderCancelOrderParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('order/cancelOrder', 'POST', data, option, 'application/x-www-form-urlencoded'),//取消订单
    applyRefund: (data?: OrderApplyRefundParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('order/applyRefund', 'POST', data, option, 'application/x-www-form-urlencoded'),//申请退款
    getShippingInfo: (data?: OrderGetShippingInfoParam, option?: any): Promise<ApiResponse<ResData<ExpressTrace>>> => request.doRequest('order/getShippingInfo', 'POST', data, option, 'application/x-www-form-urlencoded'),//获取物流信息
    confirmReceiveOrder: (data?: OrderConfirmReceiveOrderParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('order/confirmReceiveOrder', 'POST', data, option, 'application/x-www-form-urlencoded'),//确认收货
    sendBackOrder: (data?: SendBackOrderParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('order/sendBackOrder', 'POST', data, option, 'application/json'),//退货寄回
    cancelReturnApply: (data?: OrderCancelReturnApplyParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('order/cancelReturnApply', 'POST', data, option, 'application/x-www-form-urlencoded'),//取消申请
    deleteOrder: (data?: OrderDeleteOrderParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('order/deleteOrder', 'POST', data, option, 'application/x-www-form-urlencoded'),

  },
  //优惠券相关
  coupon: {
    getCouponList: (data?: CouponGetCouponListParam, option?: any): Promise<ApiResponse<ResData<PageData<CouponModel>>>> => request.doRequest('coupon/getCouponList', 'GET', data, option),//获取优惠券列表
    exchangeCoupon: (data?: CouponExchangeCouponParam, option?: any): Promise<ApiResponse<ResData<CouponModel>>> => request.doRequest('coupon/exchangeCoupon', 'POST', data, option, 'application/x-www-form-urlencoded'),//兑换优惠券
    getCollectableCouponList: (data?: any, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('coupon/getCollectableCouponList', 'GET', data, option),//兑换优惠券
    collectCoupon: (data?: any, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('coupon/collectCoupon', 'POST', data, option, 'application/x-www-form-urlencoded'),//兑换优惠券
  },
  //报告相关
  report: {
    getReportList: (data?: ReportGetReportListParam, option?: any): Promise<ApiResponse<ResData<PageData<ReportModel>>>> => request.doRequest('report/getReportList', 'GET', data, option),//获取报告列表
    getReportPDFUrl: (data?: ReportGetReportPDFUrlParam, option?: any): Promise<ApiResponse<ResData<string>>> => request.doRequest('report/getReportPDFUrl', 'GET', data, option),//获取报告PDF地址
    applyReportExplain: (data?: ReportApplyReportExplainParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('report/applyReportExplain', 'POST', data, option, 'application/x-www-form-urlencoded'),//申请报告解读
    getSendReportSmsValidateImage: (data?: any, option?: any): Promise<any> => request.doRequest('report/getSendReportSmsValidateImage', 'GET', data, option, "x-image-key", 'arraybuffer'),//获取图片验证码(查询他人)
    sendQueryReportSms: (data?: ReportSendQueryReportSmsParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('report/sendQueryReportSms', 'POST', data, option, 'application/x-www-form-urlencoded'),//发送查询他人验证码
    checkQueryReportSms: (data?: ReportCheckQueryReportSmsParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('report/checkQueryReportSms', 'POST', data, option, 'application/x-www-form-urlencoded'),//验证查询他人验证码
    queryReport: (data?: ReportQueryReportParam, option?: any): Promise<ApiResponse<ResData<PageData<ReportModel>>>> => request.doRequest('report/queryReport', 'GET', data, option),//查询他人报告
    majorQueryReport: (data?: ReportMajorQueryReportParam, option?: any): Promise<ApiResponse<ResData<PageData<ReportModel>>>> => request.doRequest('report/majorQueryReport', 'GET', data, option),//客户查询
    getBatchDownloadUrl: (data?: Array<number>, option?: any): Promise<ApiResponse<ResData<string>>> => request.doRequest('report/getBatchDownloadUrl', 'POST', data, option, 'application/json'),//获取批量下载url
  },
  //地址相关
  address: {
    getAddressList: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<AddressModel>>>> => request.doRequest('address/getAddressList', 'GET', data, option),//获取地址列表
    addAddress: (data?: AddressParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('address/addAddress', 'POST', data, option, 'application/json'),//新增地址
    getAddressDetail: (data?: AddressGetAddressDetailParam, option?: any): Promise<ApiResponse<ResData<AddressModel>>> => request.doRequest('address/getAddressDetail', 'GET', data, option),//获取地址详情
    editAddress: (data?: AddressParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('address/editAddress', 'POST', data, option, 'application/json'),//编辑地址
    makeDefault: (data?: AddressMakeDefaultParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('address/makeDefault', 'POST', data, option, 'application/x-www-form-urlencoded'),//设为默认
    deleteAddress: (data?: AddressDeleteAddressParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('address/deleteAddress', 'POST', data, option, 'application/x-www-form-urlencoded'),//删除地址
  },
  //消息相关
  message: {
    getMessageList: (data?: MessageGetMessageListParam, option?: any): Promise<ApiResponse<ResData<PageData<MessageModel>>>> => request.doRequest('message/getMessageList', 'GET', data, option),//获取消息列表
    readMessage: (data?: MessageReadMessageParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('message/readMessage', 'POST', data, option, 'application/x-www-form-urlencoded'),//将消息设置为已读
  },
  //检测相关
  testing: {
    getTestingList: (data?: TestingGetTestingListParam, option?: any): Promise<ApiResponse<ResData<PageData<TestingModel>>>> => request.doRequest('testing/getTestingList', 'GET', data, option),//获取检测列表
    getTestingDetail: (data?: TestingGetTestingDetailParam, option?: any): Promise<ApiResponse<ResData<TestingModel>>> => request.doRequest('testing/getTestingDetail', 'GET', data, option),//获取检测详情
  },
  //地区相关
  district: {
    getDistricts: (data?: DistrictGetDistrictsParam, option?: any): Promise<ApiResponse<ResData<Array<DistrictModel>>>> => request.doRequest('district/getDistricts', 'GET', data, option),//获取地区列表
  },
  //分销相关
  reseller: {
    getResellerInfo: (data?: any, option?: any): Promise<ApiResponse<ResData<ResellerInfo>>> => request.doRequest('reseller/getResellerInfo', 'GET', data, option),//获取分销信息
    applyForReseller: (data?: ResellerApplyForResellerParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('reseller/applyForReseller', 'POST', data, option, 'application/x-www-form-urlencoded'),//申请成为分销商
    getInvitedUserList: (data?: ResellerGetInvitedUserListParam, option?: any): Promise<ApiResponse<ResData<PageData<InvitedUser>>>> => request.doRequest('reseller/getInvitedUserList', 'GET', data, option),//获取已邀请用户列表
    getInvitedOrderList: (data?: ResellerGetInvitedOrderListParam, option?: any): Promise<ApiResponse<ResData<PageData<InvitedOrder>>>> => request.doRequest('reseller/getInvitedOrderList', 'GET', data, option),//获取已邀请订单列表
  },
  //商品相关
  commodity: {
    getCommodityList: (data?: CommodityGetCommodityListParam, option?: any): Promise<ApiResponse<ResData<PageData<CommodityModel>>>> => request.doRequest('commodity/getCommodityList', 'GET', data, option),//获取商品列表
    getCategories: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<CategoryModel>>>> => request.doRequest('commodity/getCategories', 'GET', data, option),//获取分类列表
    getEventCommodityList: (data?: CommodityGetEventCommodityListParam, option?: any): Promise<ApiResponse<ResData<Array<CommodityModel>>>> => request.doRequest('commodity/getEventCommodityList', 'GET', data, option),//获取活动商品列表
    getCommodityDetail: (data?: CommodityGetCommodityDetailParam, option?: any): Promise<ApiResponse<ResData<CommodityModel>>> => request.doRequest('commodity/getCommodityDetail', 'GET', data, option),//获取商品详情
  },
  //样本绑定相关
  sampleBind: {
    checkSampleCode: (data?: SampleBindCheckSampleCodeParam, option?: any): Promise<ApiResponse<ResData<CheckSampleCodeResult>>> => request.doRequest('sampleBind/checkSampleCode', 'POST', data, option, 'application/x-www-form-urlencoded'),//检查样本编号
    getTestingItemList: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<TestingItemModel>>>> => request.doRequest('sampleBind/getTestingItemList', 'GET', data, option),//获取检测项目列表
    bindSample: (data?: BindSampleParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('sampleBind/bindSample', 'POST', data, option, 'application/json'),//绑定样本
    getBoundSampleList: (data?: SampleBindGetBoundSampleListParam, option?: any): Promise<ApiResponse<ResData<PageData<BoundSampleModel>>>> => request.doRequest('sampleBind/getBoundSampleList', 'GET', data, option),//获取已绑定样本列表
    batchBind: (data?: Array<BindSampleParam>, option?: any): Promise<ApiResponse<ResData<Array<BatchBandResult>>>> => request.doRequest('sampleBind/batchBind', 'POST', data, option, 'application/json'),//批量绑定大客户功能

  },
  //呼叫物流相关
  callExpress: {
    getCallExpressLog: (data?: CallExpressGetCallExpressLogParam, option?: any): Promise<ApiResponse<ResData<PageData<CallExpressLogModel>>>> => request.doRequest('callExpress/getCallExpressLog', 'GET', data, option),//获取呼叫物流记录
    getUsableTimeList: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<CallExpressUsableTime>>>> => request.doRequest('callExpress/getUsableTimeList', 'GET', data, option),// 获取可用时间段
    getSampleTypes: (data?: any, option?: any): Promise<ApiResponse<ResData<Array<SampleTypeModel>>>> => request.doRequest('callExpress/getSampleTypes', 'GET', data, option),//获取样本类型列表
    makeCallExpress: (data?: MakeCallExpressParam, option?: any): Promise<ApiResponse<ResData<any>>> => request.doRequest('callExpress/makeCallExpress', 'POST', data, option, 'application/json'),//呼叫物流
    getCallExpressDetail: (data?: CallExpressGetCallExpressDetailParam, option?: any): Promise<ApiResponse<ResData<CallExpressLogModel>>> => request.doRequest('callExpress/getCallExpressDetail', 'POST', data, option, 'application/x-www-form-urlencoded'),//获取呼叫物流详情
    getCallExpressTrace: (data?: CallExpressGetCallExpressTraceParam, option?: any): Promise<ApiResponse<ResData<ExpressTrace>>> => request.doRequest('callExpress/getCallExpressTrace', 'GET', data, option),//获取寄回详情
  },
  //图片相关
  image: {
    getUploadParam: (data?: ImageGetUploadParamParam, option?: any): Promise<ApiResponse<ResData<UploadParamModel>>> => request.doRequest('image/getUploadParam', 'POST', data, option, 'application/x-www-form-urlencoded'),
  },
  // 文本相关 
  texts: {
    getAboutUs: (data?: any, option?: any): Promise<ApiResponse<ResData<string>>> => request.doRequest('texts/getAboutUs', 'GET', data, option),
    getInformedConsentForm: (data?: any, option?: any): Promise<ApiResponse<ResData<string>>> => request.doRequest('texts/getInformedConsentForm', 'GET', data, option),
    getUserServiceAgreement: (data?: any, option?: any): Promise<ApiResponse<ResData<string>>> => request.doRequest('texts/getUserServiceAgreement', 'GET', data, option),
    getPrivacyPolicy: (data?: any, option?: any): Promise<ApiResponse<ResData<string>>> => request.doRequest('texts/getPrivacyPolicy', 'GET', data, option),
    getDisclaimerNotices: (data?: any, option?: any): Promise<ApiResponse<ResData<string>>> => request.doRequest('texts/getDisclaimerNotices', 'GET', data, option),
  }
}